uniform sampler2D image;
uniform float width; //set to 0 for no blur, 1, 2, 3 for more blurring

const float step_w = 0.00195 * width; //1/512
const float step_h = 0.00195 * width; 

float kernel[9] = 
{
	0.0, 1.0/8.0, 0.0,
	1.0/8.0, -4.0/8.0, 1.0/8.0,
	0.0, 1.0/8.0, 0.0
};

vec2 offset[9] =
{
	vec2(-step_w, -step_h), vec2(0.0, -step_h), vec2(step_w, -step_h),
	vec2(-step_w, 0.0), vec2(0.0, 0.0), vec2(step_w, 0.0),
	vec2(-step_w, step_h), vec2(0.0, step_h), vec2(step_w, step_h)
};

void main()
{
	vec4 sum = vec4(0, 0, 0, 0);
	for(int i = 0; i < 9; i++)
	{
		sum += texture2D(image, gl_TexCoord[0].st + offset[i]) * kernel[i];
	}
	gl_FragColor = sum;
}